package com.ljm.boot.domain;

import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;

import java.util.Date;

@Document(indexName = "user",shards = 3 , replicas = 0)
public class UserEntity {
    @Id
    private String id;

    @Field(name = "user_name")
    private String userName;

    @Field(name = "sex")
    private String sex;

    @Field(name = "age")
    private int age;
    @Field(name = "address")
    private String address;

    @Field(name = "phone_number")
    private String phoneNumber;

    @Field(name = "birth_day")
    private Date birthDay;


    public void setId(String id) {
        this.id = id;
    }

    public String getId() { return id; }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getPhoneNumber() {
        return phoneNumber;
    }

    public void setPhoneNumber(String phoneNumber) {
        this.phoneNumber = phoneNumber;
    }

    public Date getBirthDay() {
        return birthDay;
    }

    public void setBirthDay(Date birthDay) {
        this.birthDay = birthDay;
    }

    public UserEntity(String id, String userName, String sex, int age, String address, String phoneNumber, Date birthDay) {
        this.id = id;
        this.userName = userName;
        this.sex = sex;
        this.age = age;
        this.address = address;
        this.phoneNumber = phoneNumber;
        this.birthDay = birthDay;
    }

    public UserEntity() {
    }
}
